package com.hex.ds.hdrs.period.job.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

@Data
@Accessors(chain = true)
public class PeriodJobDefVo implements Serializable {

    private String pkId;

    private String appCode;

    private String jobCode;

    private String jobName;

    private String jobDesc;

    private String jobStatus;

    private String jobPeriod;

    private Integer sortNo;

    private Integer offsetHour;

    private String dateExpression;

    private String isValidDate;

    private String jobStDate;

    private String jobEndDate;

    private String appointAgentCode;

    private String isWorkRun;

    private String isSingleJob;

    private String[] dateRange;

    private List<String> labelCodeList;

    public String getJobStDate() {
        if ("1".equals(isValidDate) && dateRange.length == 2){
            return dateRange[0];
        }
        return null;
    }

    public String getJobEndDate() {
        if ("1".equals(isValidDate) && dateRange.length == 2){
            return dateRange[1];
        }
        return null;
    }
}
